<!DOCTYPE html>
<html lang="en">
<head>
	<link rel="shortcut icon" href="#" />
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>类继承和 super 关键字</title>
</head>
<body>
	<script>
		class Father {
			constructor(x,y) {
				this.x = x;
				this.y = y;
			}
			sum() {
				console.log(this.x + this.y)
			}
		}
		class Son extends Father {
			constructor(x,y) {
				super(x,y)
			}
		}
		var son1 = new Son(10,22)
		var son2 = new Son(15,36)
		son1.sum()
		son2.sum()

	</script>
</body>
</html>